<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/css/amazeui.min.css">
    <link rel="stylesheet" href="/css/amazeui.cropper.css">
    <link rel="stylesheet" href="/css/custom_up_img.css">


    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/commone.css">
    <link rel="stylesheet" media="screen and (min-width:481px)" href="/css/usercenter.css">
    <link rel="stylesheet" media="screen and (max-width:480px)" href="/css/usercenter(1).css">

    <script src="/js/hm.js"></script>
    <script type="text/javascript">
        var basePath = "/";
    </script>
    <script src="/js/common.js"></script>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/js/footfixed.js"></script>

    <script src="/js/layer.js"></script>
    <link rel="stylesheet" href="/css/layer.css" id="layuicss-layer">
    <title>个人中心</title>


    <script src="/js/amazeui.min.js"></script>
    <script src="/js/cropper.min.js"></script>
    <script src="/js/custom_up_img.js"></script>

</head>
<body th:fragment="user_right">
    <div th:replace="common/hasbei_top_user"></div>
    <div class="content-main">
        <div class="main-info">
            <div th:replace="user/user_left"></div>
            <div class="main-user-right">

                <input type="hidden" id="no" value="1284812510989520896">
                <div class="user-right-top">
                    <ul>
                        <li class="select-active" id="dy"><a href="javascript:;">动态</a></li>
                        <li id="q" class=""><a href="javascript:;">提问&nbsp;1</a></li>
                        <li id="an" class=""><a href="javascript:;">回答&nbsp;1</a></li>
                        <li id="art" class=""><a href="javascript:;">文章&nbsp;0</a></li>
                    </ul>
                </div>

                <div class="user-right-action">
                    <div id="myContent"><div class="action-item">

                        <div class="action-item-top">
                            <div class="item-span">



                                <span class="status-word">回答了问题</span>



                                <span class="time">2020-07-21</span>
                            </div>
                            <span class="delete" onclick="delDy(this)" id="263" style="display:none">x</span>
                        </div>
                        <div class="action-item-title">



                            <a href="/qa/detail/202007191284852930758971392" target="_blank">萧华林牙痛?</a>


                        </div>



                        <div class="ansower-collect">
                            <span>2回答</span>
                            <span class="dotted"></span>
                            <span>0收藏</span>
                        </div>



                        <!-- 头像 <div class="action-img-name">
                        <a href=""><img src="images/User.png" alt="有贝口腔网"><span>十高手手</span></a>
                        </div> -->
                        <div class="ansower-content">
                            <a target="_blank">[回答内容] 建议去拔掉，懂？？？？？</a>
                        </div>

                        <div class="ansower-share-setting">
                            <div class="ansower-share">


                                <!-- 回答 -->

                                <a href="javascript:;" target="_self"><span>1点赞</span></a>
                                <a href="javascript:;" target="_self"><span>0评论</span></a>


                                <!-- <div style="margin-top: -2px;">
                                    <a href=""><img src="images/icon_Share.png" alt="有贝口腔网"><span>分享</span></a>
                                </div> -->

                            </div>
                        </div>


                    </div></div>
                    <div class="more-content">
                        <div class="load-more" style="display: none;">
                            <img src="/img/load-more.gif">
                            <span>加载中</span>
                        </div>
                        <div class="load-more-two load-more-fade" style="" onclick="moreList()">点击加载更多</div>
                        <div class="no-data" style="display: none;">┭┮﹏┭┮,没有数据啦</div>
                    </div>
                </div>

            </div>
        </div>
    </div>


</body>
<script>

    var current=1;
    var tabId="";
    var no="";//用户编号
    //动态数据
    function dyList(){
        $(".load-more").show();
        $(".load-more-two").hide();
        $.post(basePath+"user/index/dy/list/"+no+"?current="+current,function(data){
            $(".load-more").hide();
            //如果没有数据了就隐藏
            if(data.length==0){
                $(".load-more-two").hide();
                if(current==1){
                    $(".no-data").show();
                }
            }else{
                $(".load-more-two").show();
                $("#myContent").append(data);
            }
        });
    }
    //提问数据
    function qaList(){
        $(".load-more").show();
        $(".load-more-two").hide();
        $.post(basePath+"user/index/qalist/"+no+"?current="+current,function(data){
            $(".load-more").hide();
            //如果没有数据了就隐藏
            if(data.length==0){
                $(".load-more-two").hide();
                if(current==1){
                    $(".no-data").show();
                }
            }else{
                $(".load-more-two").show();
                $("#myContent").append(data);
            }
        });
    }
    //回答数据列表
    function qaReplyList(){
        $(".load-more").show();
        $(".load-more-two").hide();
        $.post(basePath+"user/index/qaReplylist/"+no+"?current="+current,function(data){
            $(".load-more").hide();
            //如果没有数据了就隐藏
            if(data.length==0){
                $(".load-more-two").hide();
                if(current==1){
                    $(".no-data").show();
                }
            }else{
                $(".load-more-two").show();
                $("#myContent").append(data);
            }
        });
    }
    //文章数据列表
    function articleList(){
        $(".load-more").show();
        $(".load-more-two").hide();
        $.post(basePath+"user/index/articlelist/"+no+"?current="+current,function(data){
            $(".load-more").hide();
            //如果没有数据了就隐藏
            if(data.length==0){
                $(".load-more-two").hide();
                if(current==1){
                    $(".no-data").show();
                }
            }else{
                $(".load-more-two").show();
                $("#myContent").append(data);
            }
        });
    }
    function loadTabList(){
        if(tabId=='dy'){//动态
            dyList();
        }else if(tabId=='an'){// 回答
            qaReplyList();
        }else if(tabId=='q'){// 提问
            qaList();
        }else if(tabId=='art'){// 文章
            articleList();
        }
    }
    //加载更多
    function moreList(){
        current++;
        loadTabList();
    }
    function initList(){
        no=$("#no").val();
        tabId='dy';//动态
        dyList();
    }
    initList();//初始化
    // 点击tab标签
    $(".user-right-top li").click(function(){
        var id=$(this).attr("id");
        if(id==tabId){
            return ;
        }
        tabId=id;
        current=1;
        $("#myContent").html("");
        $(".load-more-two").hide();
        $(".no-data").hide();
        loadTabList();
        $("li").removeClass("select-active");
        $(this).addClass("select-active");
    })



    $(".change-info-show").hide();
    $(".change-info-btn").click(function(){
        $(".change-info-top").hide();
        $(".change-info-show").show();
    })
    $(".write-box-input").change(function(){
        var inputle = $(this).val().length;
        $(".write-box-span i").text(inputle);
    })
    $(".write-box-textarea").change(function(){
        var textareale = $(this).val().length;
        $(".write-box-right i").text(textareale);
    })
    $(".write-box-input").focus(function(){
        $(this).parent().css("border-color","rgba(41,167,230,1)");
    })
    $(".write-box-input").blur(function(){
        $(this).parent().css("border-color","#ddd");
    })
    $(".write-box-textarea").focus(function(){
        $(this).parent().css("border-color","rgba(41,167,230,1)");
    })
    $(".write-box-textarea").blur(function(){
        $(this).parent().css("border-color","#ddd");
    })


    $(".sure-btn").click(function(){
        var inputval = $(".write-box-input").val();
        var textareaval =$(".write-box-textarea").val();
        if(inputval == "" || textareaval == ""){
            alert("请输入信息");
            return false;
        }
        $(".h3-name").text(inputval);
        $(".p-style").text(textareaval);

        $(".change-info-show").hide();
        $(".change-info-top").show();
    })
    $(".close-btn").click(function(){
        $(".change-info-show").hide();
        $(".change-info-top").show();
    })

</script>
</html>